<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<!-- 引入bootstrap -->
<link rel="stylesheet" type="text/css" href="<%=request.getContextPath()%>/css/bootstrap.min.css">
<!-- 引入JQuery  bootstrap.js-->
<script src="<%=request.getContextPath()%>/js/bootstrap.min.js"></script>
<script src="<%=request.getContextPath()%>/js/jquery.validate.min.js"></script>
<script src="<%=request.getContextPath()%>/js/jquery-3.2.1.min.js"></script>
<html>
<head>
    <meta charset="UTF-8">
    <title></title>
</head>
<body>

<div id="countdown">还剩 5 分 00 秒</div>

<script>



    window.onload=function(){
        var countdown=document.getElementById("countdown");
        var time=300;//5分钟换算成300秒
        setInterval(function(){
            time=time-1;
            var minute=parseInt(time/60);
            var second=parseInt(time%60);
            countdown.innerHTML='还剩'+minute+'分'+second+'秒';
        },1000);
    };
    function go() {
        alert("竞赛时间到！！");
         document.location.href="<%=request.getContextPath()%>/exam/challenge";
    }
   setTimeout(go,300000);
</script>


</body>
</html>
